package com.wmx.collection;

import java.util.*;

public class CollectionTest {

    public static void main(String[] args) {

        List<Student> list = new ArrayList<Student>();
        list.add(new Student("张三",10));
        list.add(new Student("李四",20));
        list.add(new Student("李四",20));
        list.add(new Student("王五",4));
        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);



        Set set = new HashSet();
        for (Student student :list) {
            set.add(student);
        }

        System.out.println(set);
    }
}
